<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <script>
        //     ## 1. 斐波那契数列

        // ```javascript
        //     1 1 2 3 5 8 13 21.......
        //     推导公式：fib(m) = fib(m-1) + fib(m-2)
        // ```
        function fun(m) {
            if (m === 1 || m === 2) {
                return 1;
            } else {
                return fun(m - 1) + fun(m - 2);
            }
        }
        console.log(fun(1))
        console.log(fun(2))
        console.log(fun(3))
        console.log(fun(4))
        console.log(fun(5))
        console.log(fun(6))
    </script>
</body>

</html>